<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>js阻止默认事件及VUE路由切换原理</title>
	</head>
	<body>
		<a href="/1" onclick="fn1">测试</a>
		
		<script type="text/javascript">
			//一般可用return false或者ev.preventDefault()解决
			//例：a标签阻止跳转或刷新
			document.querySelector("a").onclick = function(ev){
				//ev.preventDefault()	//也能实现
				return false;
			}
		</script>
	</body>
</html>
